<!--
  刷新按钮：
  import RefreshButton from '../components/RefreshButton' // 分页插件
  <RefreshButton :refreshList="getTableData"></RefreshButton>
-->
<template>
    <Button size="small" icon="md-refresh" style="margin-right: 5px" @click="findPage">刷新</Button>
</template>

<script>
    import {mapState, mapGetters, mapActions, mapMutations} from 'vuex'; // 引入vuex

    export default {
        name: "RefreshButton",
        data() {
            return {}
        },
        props: {
            refreshList: {
                type: Function,
                default: null
            }
        },
        methods: {
            ...mapMutations("system", ["setBreadcrumb", "setSpinShow"]),
            findPage() {
                // 调用父组件的获取列表数据方法
                this.refreshList()
                this.setSpinShow(true);
                setTimeout(() => {
                    this.setSpinShow(false);
                }, 250);
            }
        }
    }
</script>
<style scoped>

</style>
